﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="geonet.aspx.cs" Inherits="SIS_Wcf_Server.geonet" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <!-- 
        http://maps.google.com/?ie=UTF8&ll=50.680797,15.380859&spn=22.452411,52.998047&z=4
        http://maps.google.com/?ie=UTF8&ll=55.492665,9.492531&spn=0.078188,0.207024&z=12
      -->
        <asp:ListView ID="ListView1" runat="server" DataSourceID="EntityDataSource1">
            <AlternatingItemTemplate>
                <tr style="">
                    <td>
                        <asp:Label ID="LatLabel" runat="server" Text='<%# Eval("Lat") %>' />
                    </td>
                    <td>
                        <asp:Label ID="LongLabel" runat="server" Text='<%# Eval("Long") %>' />
                    </td>
                    <td>
                        <asp:Label ID="DistLabel" runat="server" Text='<%# Eval("Dist") %>' />
                    </td>
                    <td>
                        <asp:Label ID="NetIdLabel" runat="server" Text='<%# Eval("NetId") %>' />
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <tr style="">
                    <td>
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                    </td>
                    <td>
                        <asp:TextBox ID="LatTextBox" runat="server" Text='<%# Bind("Lat") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="LongTextBox" runat="server" Text='<%# Bind("Long") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="DistTextBox" runat="server" Text='<%# Bind("Dist") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="NetIdTextBox" runat="server" Text='<%# Bind("NetId") %>' />
                    </td>
                </tr>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" style="">
                    <tr>
                        <td>
                            No data was returned.</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <tr style="">
                    <td>
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                    </td>
                    <td>
                        <asp:TextBox ID="LatTextBox" runat="server" Text='<%# Bind("Lat") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="LongTextBox" runat="server" Text='<%# Bind("Long") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="DistTextBox" runat="server" Text='<%# Bind("Dist") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="NetIdTextBox" runat="server" Text='<%# Bind("NetId") %>' />
                    </td>
                </tr>
            </InsertItemTemplate>
            <ItemTemplate>
                <tr style="">
                    <td>
                        <asp:Label ID="LatLabel" runat="server" Text='<%# Eval("Lat") %>' />
                    </td>
                    <td>
                        <asp:Label ID="LongLabel" runat="server" Text='<%# Eval("Long") %>' />
                    </td>
                    <td>
                        <asp:Label ID="DistLabel" runat="server" Text='<%# Eval("Dist") %>' />
                    </td>
                    <td>
                        <asp:Label ID="NetIdLabel" runat="server" Text='<%# Eval("NetId") %>' />
                    </td>
                    <td>
                        <a href="http://maps.google.com/?ie=UTF8&ll=<%# Eval("Lat", "{0:0.######}" ).Replace(",",".") %>,<%# Eval("Long",  "{0:0.######}").Replace(",",".") %>&spn=0.078188,0.207024&z=12">link</a>
                    </td>
                </tr>
            </ItemTemplate>
            <LayoutTemplate>
                <table runat="server">
                    <tr runat="server">
                        <td runat="server">
                            <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                                <tr runat="server" style="">
                                    <th runat="server">
                                        Lat</th>
                                    <th runat="server">
                                        Long</th>
                                    <th runat="server">
                                        Dist</th>
                                    <th runat="server">
                                        NetId</th>
                                </tr>
                                <tr ID="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server" style="">
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <tr style="">
                    <td>
                        <asp:Label ID="LatLabel" runat="server" Text='<%# Eval("Lat") %>' />
                    </td>
                    <td>
                        <asp:Label ID="LongLabel" runat="server" Text='<%# Eval("Long") %>' />
                    </td>
                    <td>
                        <asp:Label ID="DistLabel" runat="server" Text='<%# Eval("Dist") %>' />
                    </td>
                    <td>
                        <asp:Label ID="NetIdLabel" runat="server" Text='<%# Eval("NetId") %>' />
                    </td>

                </tr>
            </SelectedItemTemplate>
        </asp:ListView>
    </div>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        AutoGenerateOrderByClause="True" ConnectionString="name=SISDBEntities" 
        DefaultContainerName="SISDBEntities" EnableFlattening="False" 
        EntitySetName="geocoded_nets" OrderBy="" 
        Select="it.[Lat], it.[Long], it.[Dist], it.[NetId]">
    </asp:EntityDataSource>
    </form>
</body>
</html>
